<?php if($this->error == 1){?>
<center><?php echo $this->textError1;?></center>
<?php } else if($this->error==2) {?>
<center><?php echo $this->textError2;?></center>
<?php }else{?>
<link rel="stylesheet" type="text/css" href="/css/EditMostView.css" />
	<div id="content">
		<div id="edit_module">
		<form action="" name="frm_edit">
			<div id="edit_content">
					<?php echo $this->textTitle;?>
					<br/>
					<input type="text" name="title" id="title" maxlength="20" value="<?php echo $this->title;?>" class="info">
					<br/><br/>
					<?php echo $this->textOrder;?>
					<br/>
					<input type="text" name="sort" id="sort" maxlength="11" value="<?php echo $this->sort;?>" class="info">
					<br/><br/>
					<?php echo $this->textLimit;?>
					<br/>
					<input type="text" name="limit" id="limit" maxlength="10" value="<?php echo $this->limit;?>" class="info">
					<br/>	
			</div>
			<div id="submit_btn">
				<input type="button" value="<?php echo $this->textSave;?>" onclick = "EditModule(<?php echo "'".$this->name."','".$this->textAlert1."','".$this->textAlert2."','".$this->textAlert3."','".$this->textAlert4."','".$this->textAlert5."','".$this->textAlert6."','".$this->textAlert7."','".$this->language."'";?>);">
			</div>
		</form>
		</div>
	</div>

<script type="text/javascript">

function EditModule(module_code, alert1, alert2, alert3, alert4, alert5, alert6, alert7, language)
{
	var _title= document.getElementById("title").value ;
	var _limit= document.getElementById("limit").value ;
	var _sort= document.getElementById("sort").value ;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange = function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			if(xmlhttp.responseText == "-1")
			{
				alert(alert1);
			}
			else if(xmlhttp.responseText == "-2" )
			{
				alert(alert2);
			}
			else if(xmlhttp.responseText == "-3")
			{
				alert(alert3);
			}
			else if(xmlhttp.responseText == "-7")
			{
				alert(alert7);
			}
			else if(xmlhttp.responseText == "-4")
			{
				alert(alert4);
			}
			else if(xmlhttp.responseText == "-6")
			{
				alert(alert6);
			}
			else if(xmlhttp.responseText == "-5")
			{
				alert(alert5);
			}
			else
			{	
				window.parent.$.prettyPhoto.close();
				window.top.location.reload();
			}
		}	
	};
	var url = "/mostviewnews/clickchange/edit?name="+module_code+"&sort="+_sort+"&title="+_title+"&limit="+_limit+"&language="+language;
	xmlhttp.open("GET",url,true);	
	xmlhttp.send();
	return false;
}
</script>

<?php }?>